using System;
using System.Collections.Generic;
using System.Text;

namespace RikMigrations
{
	public enum CascadeOptions
	{
		NoAction,
		Cascade,
		SetNull,
		SetDefault
	}

	public class ForeignKey
	{
		public ForeignKey(string name, Table table, string column, string foreignTable, string foreignColumn)
		{
			this.name = name;
			this.table = table;
			this.column = column;
			this.foreignTable = foreignTable;
			this.foreignColumn = foreignColumn;
		}

		#region Properties
		private string name;
		public string Name
		{
			get { return name; }
			set { name = value; }
		}

		private Table table;
		public Table Table
		{
			get { return table; }
			set { table = value; }
		}

		private string column;
		public string Column
		{
			get { return column; }
			set { column = value; }
		}

		private string foreignTable;
		public string ForeignTable
		{
			get { return foreignTable; }
			set { foreignTable = value; }
		}

		private string foreignColumn;
		public string ForeignColumn
		{
			get { return foreignColumn; }
			set { foreignColumn = value; }
		}

		private CascadeOptions deleteCascadeOption;
		public CascadeOptions DeleteCascadeOption
		{
			get { return deleteCascadeOption; }
			set { deleteCascadeOption = value; }
		}

		private CascadeOptions updateCascadeOption;
		public CascadeOptions UpdateCascadeOption
		{
			get { return updateCascadeOption; }
			set { updateCascadeOption = value; }
		}
		#endregion

		public ForeignKey OnDelete(CascadeOptions option)
		{
			deleteCascadeOption = option;
			return this;
		}

		public ForeignKey OnUpdate(CascadeOptions option)
		{
			updateCascadeOption = option;
			return this;
		}
	}
}